/**
  * 读取用户菜单
  * @module 读取用户菜单
 * @author 徐灿
 * @date 2018-7-26
  */
'use strict';

const conn = require('../../libs/Conn');

module.exports = async function (group_id,user_name) {
    try {
        let getMenusSql = `SELECT * FROM user_group ug WHERE ug.group_id= ?`,
            sysmenuData = (await conn(getMenusSql, [group_id])).shift();//获取当前登录用户对应的菜单权限
        return {data: sysmenuData || {},user_name:user_name};
    } catch (e) {
        return {success: false, message: e};
    }
};